﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernateDown2Earth.Core.Entities;

namespace NHibernateDown2Earth.Core.Mapping
{
	public class CategoryMap: ClassMap<Category>
	{
		public CategoryMap()
		{
			Id(x => x.Id);
			Map(x => x.Name).Length(45).Not.Nullable();

			HasMany<Product>(x => x.Products)
				.KeyColumn("Category_id");
		}
	}
}
